function get_bootstrap(X_total,Y_total,d, cantidadCaracteristicas, titulo)
[fi, tex] = fopen('resultados_bootstrap.csv', 'a');



fprintf(fi, '\n Estrategia , Caract, KNN30,,,, KNN10,,,, LDA,,,, Dminimal,,,,\n');
for i=1:length(cantidadCaracteristicas)
    
    final =cantidadCaracteristicas(i);
    fprintf(fi, '\n%s, %d,',titulo, final);
    X = squeeze(X_total(i,:,1:final));
    Y = squeeze(Y_total(i,:,1:final));
    X = [X;Y];
     bootstrap(X,d,500,'knn',30);
     bootstrap(X,d,500,'knn',10);
     bootstrap(X,d,500,'lda');
     bootstrap(X,d,500,'dminimal');
     fprintf(fi, '\n');
%     fprintf(fi, ' %f ,%f ,%f, %f,', th(j(c1)),ths ,th(j(c2)), c*100);
%     for j=1:500;
%         [TT per(:,j)] = bootstrap(X,d,10,'knn',30);
%     end;
%     A =Confianza(per);
%     fprintf(fi, '\n%d, %f ,%f ,%f,', final,mean(per(:)) , A(1), A(2));
%     for j=1:500;
%         [TT per(:,j)] = bootstrap(X,d,10,'knn',10);
%     end;
%     A =Confianza(per);
%     fprintf(fi, '%f ,%f ,%f,',mean(per(:)), A(1), A(2));
%     for j=1:500;
%         [TT per(:,j)] = bootstrap(X,d,10,'lda');
%     end;
%     A =Confianza(per);
%     fprintf(fi, '%f ,%f ,%f,',mean(per(:)) , A(1), A(2));
%     for j=1:500;
%         [TT per(:,j)] = bootstrap(X,d,10,'dminimal');
%     end;
%     A =Confianza(per);
%     fprintf(fi, '%f ,%f ,%f,',mean(per(:)) , A(1), A(2));
   
end
 st = fclose(fi);
end
function confidence = Confianza(per)
per_s = sort(per);
idx = round(length(per))*(1-.95/2);
con = per_s(idx:end-idx);
confidence = [con(1);con(end)];
end